<include file="Public/right_chat_panel"/>
<php> //D('Home/Member')->need_login();</php>
<!--[if lt IE 8]>
<div class="alert alert-danger" style="margin-bottom: 0">您正在使用 <strong>过时的</strong> 浏览器. 是时候 <a target="_blank"
                                                                                                href="http://browsehappy.com/">更换一个更好的浏览器</a>
    来提升用户体验.
</div>
<![endif]-->

<php>
    $unreadMessage=D('Common/Message')->getHaventReadMeassageAndToasted(is_login());
</php>
<div id="nav_bar" class="nav_bar">
    <nav class="container navbar-static-top" id="nav_bar_container" role="navigation">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1">
                <span class="sr-only">打开下拉菜单</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="logo" href="{:U('Home/Index/index')}"><img src="__ROOT__/Public/images/logo.png"/></a>
        </div>
        <div class="collapse navbar-collapse " id="nav_bar_main">
            <ul class="nav navbar-nav">
                <think:nav name="nav">
                    <eq name="nav.pid" value="0">
                        <php>
                            $children=D('Channel')->where(array('pid'=>$nav['id']))->order('sort asc')->select();
                            if($children){
                        </php>
                        <li class="dropdown">
                            <a class="dropdown-toggle nav_item" data-toggle="dropdown" href="#"
                               style="color:{$nav.color}"><i class="icon-{$nav.icon}"></i>

                                {$nav.title} <span class="caret"></span>
                                <neq name="nav.band_text" value=""><span class="badge"
                                                                         style="background: {$nav.band_color}">{$nav.band_text}</span>
                                </neq>
                            </a>
                            <ul class="dropdown-menu">
                                <volist name="children" id="subnav">
                                    <li role="presentation"><a role="menuitem" tabindex="-1"
                                                               style="color:{$subnav.color}"
                                                               href="{$subnav.url|get_nav_url}"
                                                               target="<eq name='subnav.target' value='1'>_blank<else/>_self</eq>">{$subnav.title}
                                        <neq name="subnav.band_text" value=""><span class="badge"
                                                                                    style="background: {$subnav.band_color}">{$subnav.band_text}</span>
                                        </neq>
                                    </a>
                                    </li>
                                </volist>
                            </ul>
                        </li>
                        <php>}else{</php>
                        <li class="<eq name='nav.url|get_nav_active' value='1'>active<else/></eq>">
                            <a href="{$nav.url|get_nav_url}"
                               target="<eq name='nav.target' value='1'>_blank<else/>_self</eq>"
                               style="color:{$nav.color}"><i class="icon-{$nav.icon}"></i> {$nav.title}
                                <neq name="nav.band_text" value=""><span class="badge"
                                                                         style="background: {$nav.band_color}">{$nav.band_text}</span>
                                </neq>
                            </a>
                        </li>
                        <php>}</php>
                    </eq>
                </think:nav>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <!--   <li>
                       &lt;!&ndash;换肤功能预留&ndash;&gt;
                        <a><i class="icon-magic"></i></a>
                        &lt;!&ndash;换肤功能预留end&ndash;&gt;
                    </li>-->
                <!--登陆面板-->
                <if condition="is_login()">
                    <li class="dropdown  hidden-xs hidden-sm">
                        <div></div>
                        <a id="nav_info" class="dropdown-toggle text-left" data-toggle="dropdown">
                            <span class="icon-bell-alt"></span> 消息
                            <span id="nav_bandage_count"
                            <if condition="count($unreadMessage) eq 0"> style="display: none"</if>
                            class="label label-badge label-success">{:count($unreadMessage)}</span>
                            &nbsp;
                        </a>
                        <ul class="dropdown-menu extended notification">
                            <li>
                                <div class="clearfix header">
                                    <div class="col-xs-6 nav_align_left"><span
                                            id="nav_hint_count">{:count($unreadMessage)}</span> 条未读
                                    </div>
                                </div>
                            </li>
                            <li class="info-list">
                                <div class="list-wrap">
                                    <ul id="nav_message" class="dropdown-menu-list scroller  list-data"
                                        style="width: auto;">
                                        <if condition="count($unreadMessage) eq 0">
                                            <div style="font-size: 18px;color: #ccc;font-weight: normal;text-align: center;line-height: 150px">
                                                暂无任何消息!
                                            </div>
                                            <else/>
                                            <volist name="unreadMessage" id="message">
                                                <li>
                                                    <a data-url="{$message.url}"
                                                       onclick="Notify.readMessage(this,{$message.id})">
                                                        <i class="icon-bell"></i>
                                                        {$message.title}
                                            <span class="time">
                                            {$message.ctime}
                                            </span>
                                                    </a>
                                                </li>
                                            </volist>
                                        </if>

                                    </ul>
                                </div>
                            </li>
                            <li class="footer text-right">
                                <div class="btn-group">
                                    <button onclick="Notify.setAllReaded()" class="btn btn-sm  btn-success ">全部已读
                                    </button>
                                    <a class="btn  btn-sm btn-info  " href="{:U('ucenter/Message/message')}">
                                        查看消息
                                    </a>
                                </div>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a title="修改资料" href="{:U('ucenter/Config/index')}"><i
                                class="icon-cog"></i> 设置</a>
                    </li>
                    <li class="top_spliter hidden-xs"></li>
                    <li class="dropdown">
                        <php>
                            $common_header_user = query_user(array('nickname'));
                        </php>
                        <a role="button" class="dropdown-toggle dropdown-toggle-avatar" data-toggle="dropdown">
                            {$common_header_user.nickname}&nbsp;<i style="font-size: 12px"
                                                                   class="icon-chevron-down"></i>
                        </a>
                        <ul class="dropdown-menu text-left" role="menu">
                            <li><a href="{:U('ucenter/Index/index')}"><span
                                    class="glyphicon glyphicon-user"></span>&nbsp;&nbsp;个人主页</a>
                            </li>
                            <li><a href="{:U('ucenter/message/message')}"><span
                                    class="glyphicon glyphicon-star"></span>&nbsp;&nbsp;消息中心</a>
                            </li>
                            <li><a href="{:U('ucenter/Collection/index')}"><span
                                    class="glyphicon glyphicon-star"></span>&nbsp;&nbsp;我的收藏</a>
                            </li>

                            <li><a href="{:U('ucenter/Index/rank')}"><span
                                    class="glyphicon glyphicon-star"></span>&nbsp;&nbsp;我的头衔</a>
                            </li>
                            {:hook('personalMenus')}
                            <if condition="is_administrator()">
                                <li><a href="{:U('Admin/Index/index')}" target="_blank"><span
                                        class="glyphicon glyphicon-dashboard"></span>&nbsp;&nbsp;管理后台</a></li>
                            </if>
                            <li><a event-node="logout"><span
                                    class="glyphicon glyphicon-off"></span>&nbsp;&nbsp;注销</a>
                            </li>
                        </ul>
                    </li>
                    <li class="top_spliter hidden-xs"></li>
                    <else/>
                    <li class="top_spliter hidden-xs"></li>
                    <li class="hidden-xs">
                        <a href="{:U('Ucenter/Member/login')}">登录</a>
                    </li>
                    <li class="hidden-xs">
                        <a href="{:U('Ucenter/Member/register')}">注册</a>
                    </li>
                    <li class="spliter hidden-xs"></li>
                </if>
            </ul>
        </div>

        <!--导航栏菜单项-->

        <div class="row visible-xs">
            <div class="navbar-header col-xs-3 pull-right text-left">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#nav_bar_main">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
            </div>
        </div>


    </nav>
</div>

<a id="goTopBtn"></a>